const p1 = Promise.resolve(1);
const p2 = Promise.reject("失败");
Promise.allSettled([p1, p2]).then(results => {
    console.log(results);
    // 输出：[
    //   { status: "fulfilled", value: 1 },
    //   { status: "rejected", reason: "失败" }
    // ]
});